package com.eternalrights.controller;

import com.eternalrights.pojo.JobOption;
import com.eternalrights.pojo.Result;
import com.eternalrights.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;

    @GetMapping("/empJobData")
    public Result getEmpJobData(){
        log.info("获取员工职位数据");
        JobOption joboption = reportService.getEmpJobData();
        return Result.success(joboption);
    }

    @GetMapping("/empGenderData")
    public Result getEmpGenderData(){
        log.info("获取员工性别数据");
        List<Map<String,Object>> list = reportService.getEmpGenderData();
        return Result.success(list);
    }

    @GetMapping("/studentCountData")
    public Result getStudentCountData(){
        log.info("获取学生数量数据:");
        return Result.success(reportService.getStudentCountData());
    }

    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData(){
        log.info("获取学生学历数据:");
        return Result.success(reportService.getStudentDegreeData());
    }
}
